package app.sub;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@EnableAutoConfiguration
public class MainController {

	@Autowired
	private UserService userService;

	@RequestMapping("/")
	@ResponseBody
	public User home() {
		User u = userService.getById(1);
		return u;
	}

	@RequestMapping("/flush")
	@ResponseBody
	public String flush() {
		userService.update();
		return "ok";
	}
	
	@RequestMapping("/ftltest")
	public String ftlTest(Map<String,Object> map){
//		System.out.println(new File("./").getAbsolutePath());
		map.put("name", "liukun");
		return "test";
	}
	

}
